<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>房建类别--新增单体</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Expires" CONTENT="0">
    <meta http-equiv="Cache-Control" content="no-siteapp,no-transform,no-store, no-cache, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <script type="text/javascript" src="/lib/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="/static/css/buildUnit/common.css">
    <style>
        .xfBox.hide {
            display: none;
        }
    </style>
</head>
<form id="form" class="layui-form layui-form-pane" action="" lay-filter="example">
    <div class="layui-colla-content layui-show">
        <table class="layui-table v-table">
            <colgroup>
                <col width="16%">
                <col width="13%">
                <col width="13%">
                <col width="16%">
                <col width="15%">
                <col width="15%">
            </colgroup>
            <tbody>
            <tr>
                <td class="th8">单体名称</td>
                <td colspan="5">
                    <input type="hidden" name="singleId" class="formData">
                    <input name="singlePrjName" type="text" lay-verify="isEmpty" class="layui-input formData"
                           placeholder="单体名称">
                </td>
            </tr>
            <tr>
                <td class="th8">工程类型</td>
                <td colspan="5">
                    <select id="prjCategory" name="prjCategory" lay-verify="isEmpty" lay-filter="provinceNum "
                            class="formData">
                    </select>
                </td>
            </tr>
            <tr>
                <td class="th8 required">地上层数</td>
                <td colspan="2">
                    <input name="landLayer" type="text" lay-verify="isEmpty" class="layui-input formData"
                           placeholder="地上层数">
                </td>
                <td class="th8 required">地下层数</td>
                <td colspan="2">
                    <input name="undergroundLayer" type="text" lay-verify="isEmpty" class="layui-input formData"
                           placeholder="地下层数">
                </td>
            </tr>
            <tr>
                <td class="th8 required">建筑面积（㎡）</td>
                <td colspan="2">
                    <input name="singleBuildingArea" type="text" lay-verify="isEmpty" class="layui-input formData"
                           placeholder="建筑面积（㎡）">
                </td>
                <td class="th8 required">高度或埋深（m）</td>
                <td colspan="2">
                    <input name="heightOrDepth" type="text" lay-verify="isEmpty" class="layui-input formData"
                           placeholder="高度或埋深（m)">
                </td>
            </tr>
            <tr>
                <td class="th8 required">结构类型</td>
                <td colspan="5">
                    <select id="structureType" name="structureType" lay-verify="isEmpty" lay-filter="provinceNum"
                            class="formData">
                    </select>
                </td>
            </tr>
            <tr>
                <td class="th8 required">基础形式</td>
                <td colspan="5">
                    <select id="foundationForm" name="foundationForm" lay-verify="isEmpty" lay-filter="provinceNum"
                            class="formData">
                    </select>
                </td>
            </tr>
            <tr>
                <td class="th8 required">耐火等级</td>
                <td colspan="2">
                    <select id="fireResistantLevel" name="fireResistantLevel" lay-verify="isEmpty" lay-filter="provinceNum"
                            class="formData">
                    </select>
                </td>

            </tr>
            <tr class="xfBox hide">
                <td class="th8 required">防火分区数量</td>
                <td colspan="5">
                    <input name="antiFirePartCount" type="text" lay-verify="isEmpty" class="layui-input formData"
                           placeholder="防火分区数量">
                </td>
            </tr>
            <tr class="xfBox hide">
                <td class="th8 required">防火分区最大面积</td>
                <td colspan="2">
                    <input name="antiFirePartMaxArea" type="text" lay-verify="isEmpty" class="layui-input formData"
                           placeholder="防火分区最大面积">
                </td>
                <td class="th8 required">防烟分区数量</td>
                <td colspan="2">
                    <input name="antiSmokePartCount" type="text" lay-verify="isEmpty" class="layui-input formData"
                           placeholder="防烟分区数量">
                </td>
            </tr>
            <tr class="xfBox hide">
                <td class="th8 required">防烟分区最大面积</td>
                <td colspan="2">
                    <input name="antiSmokePartMaxArea" type="text" lay-verify="isEmpty" class="layui-input formData"
                           placeholder="防烟分区最大面积">
                </td>
                <td class="th8 required">火灾危险性分类</td>
                <td colspan="2">
                    <input name="fireHazardClassification" type="text" lay-verify="isEmpty" class="layui-input formData"
                           placeholder="火灾危险性分类">
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <button lay-submit lay-filter="submit" style="display: none;" id="submit" class="demo1">提交</button>
</form>
<body>
<script src="/static/js/main.js"></script>
<script type="text/javascript">
    var $;
    layui.use(['jquery', 'form', 'configure', 'configureCom', 'bluebird', 'replaceStr', 'jsDictFile', 'mapExtend'], function () {
        var form = layui.form;
        var configure = layui.configure;
        var configureCom = layui.configureCom;
        var table = layui.table;
        var sessionFun = layui.sessionFun;//缓存
        $ = layui.jquery;
        var type = configureCom.GetQueryString('type');//获取是否包含消防
        if (type && type == 'xf') {
            $('.xfBox').removeClass('hide');
        }
        var singleprojectData = sessionFun.get(configure.SESSION_SINGLE_PROJECT_DATA);
        if (singleprojectData) {
            form.val('example', singleprojectData);
            configureCom.selectDataFun(configure.PRJ_CATEGORY, singleprojectData.prjCategory, '#prjCategory');//工程项目类别
            configureCom.selectDataFun(configure.PRJ_STUCTURE_TYPE, singleprojectData.structureType, '#structureType');//结构类型
            configureCom.selectDataFun(configure.FOUNDATION_FORM, singleprojectData.foundationForm, '#foundationForm');//基础形式
            configureCom.selectDataFun(configure.FIRE_RESISTANT_LEVEL, singleprojectData.fireResistantLevel, '#fireResistantLevel');//耐火等级
        } else {
            configureCom.selectDataFun(configure.PRJ_CATEGORY, '', '#prjCategory');//工程项目类别
            configureCom.selectDataFun(configure.PRJ_STUCTURE_TYPE, '', '#structureType');//结构类型
            configureCom.selectDataFun(configure.FOUNDATION_FORM, '', '#foundationForm');//基础形式
            configureCom.selectDataFun(configure.FIRE_RESISTANT_LEVEL, '', '#fireResistantLevel');//耐火等级
        }

        //监听submit提交
        form.on('submit(submit)', function (data) {
            return false;
        });
    });

    function getData() {
        return new Promise(function (res, rej) {
            var data = {};
            if (!window.formVerifyFun()) {
                return false;
            }
            $('.formData').each(function (index, item) {
                if(!$(item).closest('tr').is(':hidden')){
                    var key = $(item).attr('name');
                    data[key] = $(item).val();
                }
            });
            res({result: data});
        });
    }

</script>
</body>
</html>